define(function(){
	var stringUtils = {
		/** 省略掉多余的字符 **/
		omit: function(value, length, omitStr){
			omitStr = omitStr || "...";
			length = length || 10;
			if(value){
				return value.length <= length ? value : value.substr(0, length - 1) + omitStr;
			}else{
				return "";
			}
		},
		getValue: function(value){
			if(typeof(value) === 'string'){
				if(value && value.length > 0){
					var lower = value.toLowerCase();
					if(lower === "true"){
						return true;
					}else if(lower === "false"){
						return false;
					}else if(!isNaN(Number(lower))){
						return Number(lower);
					}else{
						return value;
					}
				}else{
					return null;
				}
			}else{
				return null;
			}
		},
		getStrLength: function(str){ 
			if(str){
				var cArr = str.match(/[^\x00-\xff]/ig);  
			    return str.length + (cArr == null ? 0 : cArr.length);  
			}
			return 0;
		}  
	};
	return stringUtils;
});